<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>env</title>
</head>
<body>
    <p>[Environment]::SetEnvironmentVariable('Path', $newPath, 'User')</p>
<p># 假设脚本和 strings.exe 放在同一目录
    $tools = Split-Path -Parent $MyInvocation.MyCommand.Path
    & "$tools\strings.exe" -accepteula 4612.dmp</p>
<h1>需要管理员权限</h1>
<p>[Environment]::SetEnvironmentVariable(
    'Path',
    [Environment]::GetEnvironmentVariable('Path','Machine') + ';D:\Tools\Sysinternals',
    'Machine'
    )</p>
    <h2>临时生效</h2>
<p>$env:PATH += ';D:\Tools\Sysinternals'</p>
    <h1>快速检验变量</h1>
<p>$env:PATH -split ';'</p>
</body>
</html>